@import 'var';

.button {
  color: $title-color;
  text-align: center;
  background-color: $primary;
  border: none;
  border-radius: 750rpx;
}

.input-placeholder,
.textarea-placeholder {
  color: $decor-color;
  line-height: 1;
}

.line {
  width: 100%;
  height: 2rpx;
  margin: 60rpx auto;
  background-color: $border-color;
}

.text-cut {
  display: block;
  overflow: hidden; //超出一行文字自动隐藏
  white-space: nowrap; //强制不换行
  text-overflow: ellipsis; //文字隐藏后添加省略号
}

@for $i from 2 through 4 {
  .text-cut-#{$i} {
    display: -webkit-box;
    max-height: 1.5em * $i;
    overflow: hidden;
    line-height: 1.3;
    text-overflow: ellipsis;
    word-wrap: break-word;
    word-break: break-all;
    -webkit-line-clamp: $i;
    // autoprefixer: on
    -webkit-box-orient: vertical;
    // autoprefixer: off
  }
}

.loading {
  &::before,
  &::after {
    position: absolute;
    display: block;
    width: 100rpx;
    transition: opacity $transition-time;
    animation: scale 2s infinite ease-in-out;
    content: '';
  }
  &::after {
    animation-delay: 1s;
  }
  &.hide {
    z-index: -1;
    opacity: 0;
    pointer-events: none;
  }
  &.fix {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: $zindex-loading;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: $bgcolor;
  }
}

@keyframes scale {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(0.33);
  }
}

.hairline,
.hairline-bottom,
.hairline-left,
.hairline-right,
.hairline-surround,
.hairline-top,
.hairline-top-bottom {
  position: relative;
}
.hairline-bottom:after,
.hairline-left:after,
.hairline-right:after,
.hairline-surround:after,
.hairline-top-bottom:after,
.hairline-top:after,
.hairline:after {
  position: absolute;
  top: -50%;
  right: -50%;
  bottom: -50%;
  left: -50%;
  box-sizing: border-box;
  border: 0 solid $border-color;
  transform: scale(0.5);
  transform-origin: center;
  content: ' ';
  pointer-events: none;
}
.hairline-top:after {
  border-top-width: 1px;
}
.hairline-left:after {
  border-left-width: 1px;
}
.hairline-right:after {
  border-right-width: 1px;
}
.hairline-bottom:after {
  border-bottom-width: 1px;
}
.hairline-top-bottom:after {
  border-width: 1px 0;
}
.hairline::after,
.hairline-surround:after {
  border-width: 1px;
}
